﻿using System;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace API
{
    internal class Program
    {
        static void Main(string[] args)
        {
            #region 数学
            //// Math 类：常用API
            //double result = Math.Pow(2, 3);
            //Console.WriteLine(result);

            //// 绝对值
            //Console.WriteLine(Math.Abs(-2));

            //// 向上取整数
            //Console.WriteLine(Math.Ceiling(5.2));

            //// 向下取整
            //Console.WriteLine(Math.Floor(5.9));

            //// 四舍五入
            //Console.WriteLine(Math.Round(5.5));

            //// 平方根
            //Console.WriteLine(Math.Sqrt(9)); 
            #endregion

            #region 字符串
            //// 去除空格
            //string str = "      abc     aaaa";
            //Console.WriteLine(str.Trim('a'));
            //// 获取长度
            //Console.WriteLine(str.Length);
            //// 123在扫码位置
            //string str2 = "abcabcdasd1235478/64";

            //Console.WriteLine(str2.IndexOf("123"));
            //Console.WriteLine(str2.LastIndexOf("123"));
            //if (str2.StartsWith("abc"))
            //{
            //    Console.WriteLine("以ABC开头");
            //}
            //Console.WriteLine(str2.ToLower());

            //int a = 123;
            //Console.WriteLine(a.ToString().PadLeft(6, '0'));

            //string str3 = "123,456,789,123,456,789,asd";
            //string[] arr = str3.Split(',');
            //foreach (string s in arr)
            //{
            //    Console.WriteLine(s);
            //}
            //string str4 = str3.Replace(',', '|');
            //Console.WriteLine(str4);
            //Console.WriteLine(str3.Substring(4, 7));
            //Console.WriteLine(str3.Concat("123456789456")); 
            #endregion

            #region 字符串拼接
            //string str_1 = "abc";
            //string str_2 = "123";
            //string str_3 = "cbd";
            //// 一共分配了5次空间
            ////string re = str_1 + str_2 + str_3;

            //StringBuilder txt = new StringBuilder();
            //txt.Append(str_1);
            //txt.Append(str_2);
            //txt.Append(str_3);
            //Console.WriteLine(txt); 
            #endregion

            #region 随机数
            //Random random = new Random();
            //Console.WriteLine(random.Next(50, 100)); 
            #endregion

            #region Array
            //int[] arr = { 1, 2, 3, 4, 5, 6, 12, 2, 4, 0 };
            //Array.Clear(arr, 3, 1);
            //foreach (int i in arr)
            //{
            //    Console.WriteLine(i);
            //} 
            #endregion

            Regex regex = new Regex(@"\w");
            if (regex.IsMatch("*****"))
            {
                Console.WriteLine("通过");
            }
            else
            {
                Console.WriteLine("拒绝");
            }
        }
    }
}
